//============================================================================
// Name        : PatternGenomAnalyserThreadStarter.cpp
// Author      : Anthea Neums, Jonas Halbach
//			   :
// Description : The Class PatternGenomAnalyserThreadStarter is just used to Create an new PatternGenomAnalyser Object to Start a new Thread with it.
//============================================================================

#include "PatternGenomAnalyserThreadStarter.h"
namespace algorithm {


/*
* The Contructer of the PatternGenomAnalyserThreadStarter just creates a new PatterGenomAnalyser-Object.
*/
PatternGenomAnalyserThreadStarter::PatternGenomAnalyserThreadStarter(FileReader *patternReader, FileReader *genomReader, int wordlength, int startpos, int length, int threadNumber)
{
	this->patternGenomAnalyser = new PatternGenomAnalyser(patternReader, genomReader, wordlength, startpos, length, threadNumber);
}

//Destructor
PatternGenomAnalyserThreadStarter::~PatternGenomAnalyserThreadStarter(void)
{
	delete patternGenomAnalyser;
}

//This operator has to be overwritten to start a new thread.
void PatternGenomAnalyserThreadStarter::operator() (){
	this->patternGenomAnalyser->findSimilarStrings();
}

// Method can be used to get the Instnce-Variable. 
PatternGenomAnalyser *PatternGenomAnalyserThreadStarter::getPatternGenomAnalyser(){
	return patternGenomAnalyser;
}

}